<!-- 模板引用 -->
<script setup lang="ts">
import { ref, onMounted, nextTick } from 'vue'

const reference = ref(null)

onMounted(() => {
  nextTick(() => {
    console.log(reference.value)
  })
})
</script>

<template>
  <div
    @click="() => console.log(reference)"
    ref="reference"
    class="template-reference"
  >
    模板引用
  </div>
</template>

<style scoped>
.template-reference {
  width: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 10px;
}
</style>
